using System;
using System.Data;
using System.Collections;

namespace APP.QUANLY.Entity
{
     /// <summary>
     /// Summary description for LOAIMATHANG.
     /// </summary>
     public class LOAIMATHANG
    {
              private Int32 _MALOAIMATHANG;
      private string _TENLOAIMATHANG;
      private string _MOTA;
      private Int32 _STATUS;
      private DateTime _NGAYTAO;
      private string _NGUOITAO;
      private DateTime _NGAYCAPNHAT;
      private string _NGUOICAPNHAT;
      private CHIETKHAULOAIMATHANGList _listCHIETKHAULOAIMATHANG;
      private MATHANGList _listMATHANG;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
		      public bool IsMALOAIMATHANGNullable
      { get { return false;  } }
      public Int32 MALOAIMATHANG
      {
         get { return _MALOAIMATHANG; }
         set { _MALOAIMATHANG = value; }
      }
      public bool IsTENLOAIMATHANGNullable
      { get { return true;  } }
      public string TENLOAIMATHANG
      {
         get { return _TENLOAIMATHANG;  }
         set { _TENLOAIMATHANG = value; }
      }
      public bool IsMOTANullable
      { get { return true;  } }
      public string MOTA
      {
         get { return _MOTA;  }
         set { _MOTA = value; }
      }
      public bool IsSTATUSNullable
      { get { return true;  } }
      public Int32 STATUS
      {
         get { return _STATUS;  }
         set { _STATUS = value; }
      }
      public bool IsNGAYTAONullable
      { get { return true;  } }
      public DateTime NGAYTAO
      {
         get { return _NGAYTAO;  }
         set { _NGAYTAO = value; }
      }
      public bool IsNGUOITAONullable
      { get { return true;  } }
      public string NGUOITAO
      {
         get { return _NGUOITAO;  }
         set { _NGUOITAO = value; }
      }
      public bool IsNGAYCAPNHATNullable
      { get { return true;  } }
      public DateTime NGAYCAPNHAT
      {
         get { return _NGAYCAPNHAT;  }
         set { _NGAYCAPNHAT = value; }
      }
      public bool IsNGUOICAPNHATNullable
      { get { return true;  } }
      public string NGUOICAPNHAT
      {
         get { return _NGUOICAPNHAT;  }
         set { _NGUOICAPNHAT = value; }
      }
public CHIETKHAULOAIMATHANGList CHIETKHAULOAIMATHANGList 
{ 
	get { return _listCHIETKHAULOAIMATHANG; }
	set { _listCHIETKHAULOAIMATHANG = value;}
}
public MATHANGList MATHANGList 
{ 
	get { return _listMATHANG; }
	set { _listMATHANG = value;}
}

        #endregion

        #region Constructors
        public LOAIMATHANG()
        {
            Reset();
        }
        public LOAIMATHANG(LOAIMATHANG obj)
        {
            	this._MALOAIMATHANG = obj.MALOAIMATHANG;
	this._TENLOAIMATHANG = obj.TENLOAIMATHANG;
	this._MOTA = obj.MOTA;
	this._STATUS = obj.STATUS;
	this._NGAYTAO = obj.NGAYTAO;
	this._NGUOITAO = obj.NGUOITAO;
	this._NGAYCAPNHAT = obj.NGAYCAPNHAT;
	this._NGUOICAPNHAT = obj.NGUOICAPNHAT;
        }
        #endregion

        public void Reset()
        {
                     _MALOAIMATHANG = EmptyValues.v_Int32;
         _TENLOAIMATHANG = EmptyValues.v_string;
         _MOTA = EmptyValues.v_string;
         _STATUS = EmptyValues.v_Int32;
         _NGAYTAO = EmptyValues.v_DateTime;
         _NGUOITAO = EmptyValues.v_string;
         _NGAYCAPNHAT = EmptyValues.v_DateTime;
         _NGUOICAPNHAT = EmptyValues.v_string;
	_listCHIETKHAULOAIMATHANG = null;
	_listMATHANG = null;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["MALOAIMATHANG"] is DBNull))
		{
			obj.MALOAIMATHANG = (Int32)reader["MALOAIMATHANG"];
		}
                if(!(reader["TENLOAIMATHANG"] is DBNull))
		{
			obj.TENLOAIMATHANG = (string)reader["TENLOAIMATHANG"];
		}
                if(!(reader["MOTA"] is DBNull))
		{
			obj.MOTA = (string)reader["MOTA"];
		}
                if(!(reader["STATUS"] is DBNull))
		{
			obj.STATUS = (Int32)reader["STATUS"];
		}
                if(!(reader["NGAYTAO"] is DBNull))
		{
			obj.NGAYTAO = (DateTime)reader["NGAYTAO"];
		}
                if(!(reader["NGUOITAO"] is DBNull))
		{
			obj.NGUOITAO = (string)reader["NGUOITAO"];
		}
                if(!(reader["NGAYCAPNHAT"] is DBNull))
		{
			obj.NGAYCAPNHAT = (DateTime)reader["NGAYCAPNHAT"];
		}
                if(!(reader["NGUOICAPNHAT"] is DBNull))
		{
			obj.NGUOICAPNHAT = (string)reader["NGUOICAPNHAT"];
		}
//            _MALOAIMATHANG = (reader["MALOAIMATHANG"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["MALOAIMATHANG"];
//            _TENLOAIMATHANG = (reader["TENLOAIMATHANG"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["TENLOAIMATHANG"];
//            _MOTA = (reader["MOTA"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["MOTA"];
//            _STATUS = (reader["STATUS"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["STATUS"];
//            _NGAYTAO = (reader["NGAYTAO"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["NGAYTAO"];
//            _NGUOITAO = (reader["NGUOITAO"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["NGUOITAO"];
//            _NGAYCAPNHAT = (reader["NGAYCAPNHAT"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["NGAYCAPNHAT"];
//            _NGUOICAPNHAT = (reader["NGUOICAPNHAT"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["NGUOICAPNHAT"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(Int32 MALOAIMATHANG, string TENLOAIMATHANG, string MOTA, Int32 STATUS, DateTime NGAYTAO, string NGUOITAO, DateTime NGAYCAPNHAT, string NGUOICAPNHAT)
        {
                     this._MALOAIMATHANG = MALOAIMATHANG;
         this._TENLOAIMATHANG = TENLOAIMATHANG;
         this._MOTA = MOTA;
         this._STATUS = STATUS;
         this._NGAYTAO = NGAYTAO;
         this._NGUOITAO = NGUOITAO;
         this._NGAYCAPNHAT = NGAYCAPNHAT;
         this._NGUOICAPNHAT = NGUOICAPNHAT;
        }
    }
}